home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c++-part1 / 5186 < prev    next >
Encoding:
Internet Message Format  |  1996-08-06  |  1016 b 

  1. Path: news.eecs.uic.edu!usenet
  2. From: smutreja@eecs.uic.edu (Shitij Mutreja)
  3. Newsgroups: comp.lang.c++
  4. Subject: FILE I/O problem in C++????
  5. Date: 2 Feb 1996 21:55:25 GMT
  6. Organization: University of Illinois at Chicago
  7. Distribution: world
  8. Message-ID: <4eu18d$f1r@news.eecs.uic.edu>
  9. Reply-To: smutreja@eecs.uic.edu
  10. NNTP-Posting-Host: bert.eecs.uic.edu
  11.  
  12.  Hi,
  13.  
  14.     I am writing  some code in which I open a file for input and output as
  15.  
  16.                 file.open("atm.out", ios::in|ios::app);
  17.  
  18.      Then I go on to search the file for an object with a required attribute
  19.      value(data member value). I get this object into a temp object as
  20.                file>>acm1; // >> has been overloaded
  21.  
  22.       and then modify the attribute. I mark the position using 
  23.                file.seekp(mark);
  24.  
  25.       However I am finding that the modified object is being written only
  26.        at the END of the file.
  27.  
  28.     Anyone have a clue as to why this happens, and how I can get around this problem.
  29.  
  30.    Thanks,
  31.     Shitij Mutreja.
  32.  
  33.  
  34.  
  35.